package org.spiderflow.config.exception;

import org.spiderflow.config.GlobalErrorInfoEnum;
import org.spiderflow.config.permission.PermissionCodeEnum;

/**
 * 自定义异常类
 * Created by 5407 on 2018/9/25.
 */
public class ExecptionWhole extends RuntimeException{

    public ExecptionWhole(String code, String msg){
        this.code=code;
        this.msg=msg;
    }

    public ExecptionWhole(GlobalErrorInfoEnum gei){
        this.code=gei.getCode();
        this.msg=gei.getMessage();
    }

    public ExecptionWhole(PermissionCodeEnum per){
        this.code=per.getCode();
        this.msg="无权限： "+per.getDescription();
    }



    private String code;
    private String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}